package com.lmx.repoDomain.tmodel;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import io.katharsis.resource.annotations.JsonApiResource;
import io.katharsis.resource.annotations.JsonApiToOne;

/**
 * 反馈建议评分详细
 *
 * @author ytche
 * @date 2017年7月25日
 *
 */
@Entity
@Table(name = "feed_back_result_item")
@JsonApiResource(type = "feed_back_result_item")
public class FeedBackResultItem extends BaseEntity {

	private static final long serialVersionUID = 1L;
	private FeedBackItem feedBackItem;
	private Feedback feedBack;
	private Integer score;
	private String remark;

	@JsonApiToOne
	@OneToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "item_id")
	public FeedBackItem getFeedBackItem() {
		return feedBackItem;
	}

	public void setFeedBackItem(FeedBackItem feedBackItem) {
		this.feedBackItem = feedBackItem;
	}

	@JsonApiToOne
	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
	@JoinColumn(name = "feed_back_id")
	public Feedback getFeedBack() {
		return feedBack;
	}

	public void setFeedBack(Feedback feedBack) {
		this.feedBack = feedBack;
	}

	@Column(name = "score")
	public Integer getScore() {
		return score;
	}

	public void setScore(Integer score) {
		this.score = score;
	}

	@Column(name = "remark")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

}
